var t = getApp();

Page({
    data: {},
    onLoad: function(t) {
        t && this.setData({
            id: t.id,
            form_id: t.form_id
        }), this.getData();
    },
    onReady: function() {},
    onShow: function() {},
    onHide: function() {},
    onUnload: function() {},
    onPullDownRefresh: function() {},
    onReachBottom: function() {},
    onShareAppMessage: function() {},
    getData: function(a) {
        var o = this, e = this, i = t.getNetAddresss("plugin.flight-collect.frontend.index.get-form-details");
        t._getNetWork({
            url: i,
            data: {
                form_id: e.data.form_id,
                id: e.data.id
            },
            success: function(t) {
                var a = t.data;
                1 == a.result ? (a.data.diy_from.status = 1, a.data.form_data.flight_time = o.formatTimeTwo(a.data.form_data.flight_time, "Y/M/D"), 
                e.setData({
                    dfData: a.data.diy_from,
                    from: a.data.form_data
                }), wx.setNavigationBarTitle({
                    title: "航班信息收集记录"
                })) : wx.showToast({
                    title: a.msg,
                    icon: "none",
                    duration: 1e3
                });
            },
            fail: function(t) {
                console.log(t.msg);
            }
        });
    },
    formatNumber: function(t) {
        return (t = t.toString())[1] ? t : "0" + t;
    },
    formatTimeTwo: function(t, a) {
        var o = [ "Y", "M", "D", "h", "m", "s" ], e = [], i = new Date(1e3 * t);
        for (var n in e.push(i.getFullYear()), e.push(this.formatNumber(i.getMonth() + 1)), 
        e.push(this.formatNumber(i.getDate())), e.push(this.formatNumber(i.getHours())), 
        e.push(this.formatNumber(i.getMinutes())), e.push(this.formatNumber(i.getSeconds())), 
        e) a = a.replace(o[n], e[n]);
        return a;
    }
});